//package com.zmn.plat.task.job.channel;
//
//import com.github.ltsopensource.core.domain.Action;
//import com.github.ltsopensource.core.domain.Job;
//import com.github.ltsopensource.spring.tasktracker.JobRunnerItem;
//import com.github.ltsopensource.spring.tasktracker.LTS;
//import com.github.ltsopensource.tasktracker.Result;
//import com.zmn.common.constant.StatusConsts;
//import com.zmn.common.dto2.ResponseDTO;
//import com.zmn.manager.lts.interfaces.task.TaskManager;
//import com.zmn.plat.business.interfaces.channel.ChannelBService;
//import com.zmn.plat.manager.utils.TaskConsts;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.beans.factory.annotation.Autowired;
//
//import javax.annotation.PostConstruct;
//import javax.annotation.Resource;
//import java.util.Objects;
//
///**
// * 类描述：商务信息缺失发送钉钉消息
// *
// * @author hewenlang
// * @since 2022/01/07 10:24
// */
//@LTS
//public class ChannelDimissionJob {
//
//    private Logger log = LoggerFactory.getLogger(ChannelDimissionJob.class);
//
//    @Resource
//    TaskManager taskManager;
//
//    @Autowired
//    protected ChannelBService channelBService;
//
//    /**
//     * 每天早上9点扫描全表-商务信息缺失发送钉钉消息
//     * @param
//     * @return
//     * @author  hewenlang
//     * @since 2022/1/7 11:39
//     */
//    @PostConstruct
//    void init() {
//        Job job = new Job();
//        job.setTaskId(TaskConsts.TASK_ID_DIMISSION_WITHOUT_A_SINGLE_CHANNEL);
//        job.setParam(TaskManager.SHARD_FIELD, TaskConsts.TASK_ID_DIMISSION_WITHOUT_A_SINGLE_CHANNEL);
//        job.setCronExpression("0 0 9 * * ?");
//        job.setReplaceOnExist(true);
//        ResponseDTO<String> result = taskManager.submitTask2(job);
//        if (!result.isSuccess() || !Objects.equals(result.getStatus(), StatusConsts.STATUS_SUCCESS)) {
//            log.info("#ShutDownWithoutASingleChannel# job submit fail...");
//        }
//    }
//
//    /**
//     * 执行job
//     *
//     * @param job the job
//     * @return result
//     */
//    @JobRunnerItem(shardValue = TaskConsts.TASK_ID_DIMISSION_WITHOUT_A_SINGLE_CHANNEL)
//    public Result runDimissionChannelJob(Job job) {
//        log.info("#job#DimissionWithoutASingleChannel# start running... job:[{}]", job.getTaskId());
//        try {
//            channelBService.listByDimissionChannel();
//        }catch (Exception e){
//            log.info("#job#DimissionWithoutASingleChannel# fail ... job:[{}]", job.getTaskId());
//            return new Result(Action.EXECUTE_FAILED);
//        }
//        log.info("#job#DimissionWithoutASingleChannel# stop ... job:[{}]", job.getTaskId());
//        return new Result(Action.EXECUTE_SUCCESS);
//    }
//
//}
